package com.sh.redis.controller;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

public class MainTest{

    private static final String testA = "aaa";
    public static void main(String[] args) throws Exception {
        MainTest AainTest = new MainTest();
        Field testAField = AainTest.getClass().getDeclaredField("testA");
        testAField.setAccessible(true);
        Field modifiers = testAField.getClass().getDeclaredField("modifiers");
        modifiers.setAccessible(true);
        modifiers.setInt(testAField, testAField.getModifiers() & ~Modifier.FINAL);
        testAField.set(AainTest, "bbb");
        modifiers.setInt(testAField, testAField.getModifiers() & ~Modifier.FINAL);
        System.out.println(testA);
    }


}
